# _*_coding:UTF-8 _*_
# 时间复杂度O(n**2)
def insert_sort(li):
    for i in range(len(li) - 1):
        for j in range(i + 1, 0, -1):
            if li[j] > li[j - 1]:
                li[j - 1], li[j] = li[j], li[j - 1]
                print(li)
            else:
                break


li = [3, 9, 0, 8, 2, 1, 5, 4]
insert_sort(li)
print(li)
